#ifndef __PROTOCOL__OM__OmWrapper_h__
#define __PROTOCOL__OM__OmWrapper_h__

#ifdef _cplusplus
extern "C"
{
#endif

#include <omni.h>
#include <omnifact.h>
#include <omniapi.h>

#ifdef _cplusplus
}
#endif

#ifndef omniapi_session_handle
#define omniapi_session_handle void*
#endif

#include <boost/function.hpp>

namespace Greatewall
{
    namespace Protocols
    {
        namespace OM
        {
            namespace omniapi
            {
                typedef boost::function6<int32_t,
                                        omniapi_session_handle,
                                        int32_t *,
                                        uint32_t,
                                        omni_message**,
                                        uint32_t *,
                                        uint32_t *>
                        func_omniapi_tx_ex;
                extern func_omniapi_tx_ex omniapi_tx_ex;

                typedef boost::function9<int32_t,
                                         omniapi_session_handle,
                                         int32_t *,
                                         uint32_t,
                                         omni_message*,
                                         int8_t,
                                         int8_t *,
                                         uint32_t *,
                                         uint32_t *,
                                         uint32_t *>
                        func_omniapi_response_tx_ex;
                extern func_omniapi_response_tx_ex omniapi_response_tx_ex;

                typedef boost::function9<int32_t,
                                         omniapi_session_handle,
                                         int32_t *,
                                         uint32_t,
                                         omni_message*,
                                         int8_t,
                                         int8_t *,
                                         uint32_t *,
                                         uint32_t *,
                                         uint32_t *>
                        func_omniapi_query_ex;
                extern func_omniapi_query_ex omniapi_query_ex;

                typedef boost::function3<int32_t,
                                         omniapi_session_handle,
                                         uint32_t,
                                         int8_t *>
                        func_omniapi_set_event_ex;
                extern func_omniapi_set_event_ex omniapi_set_event_ex;

                typedef boost::function3<int32_t,
                                         omniapi_session_handle,
                                         uint32_t,
                                         int8_t *>
                        func_omniapi_clear_event_ex;
                extern func_omniapi_clear_event_ex omniapi_clear_event_ex;

                typedef boost::function6<int32_t,
                                         omniapi_session_handle,
                                         int32_t,
                                         int8_t *,
                                         uint32_t *,
                                         int32_t *,
                                         int32_t>
                        func_omniapi_read_event_ext_ex;
                extern func_omniapi_read_event_ext_ex omniapi_read_event_ext_ex;

                typedef boost::function5<int32_t,
                                         omniapi_session_handle,
                                         int32_t,
                                         int8_t *,
                                         uint32_t *,
                                         int32_t>
                        func_omniapi_get_message_ex;
                extern func_omniapi_get_message_ex omniapi_get_message_ex;

                typedef boost::function5<int32_t,
                                         omniapi_session_handle,
                                         int32_t,
                                         int8_t *,
                                         uint32_t *,
                                         int32_t>
                        func_omniapi_get_info_ex;
                extern func_omniapi_get_info_ex omniapi_get_info_ex;

                typedef boost::function3<int32_t,
                                         omniapi_session_handle,
                                         int32_t,
                                         int32_t>
                        func_omniapi_set_option_ex;
                extern func_omniapi_set_option_ex omniapi_set_option_ex;

#if 0
                typedef boost::function3<int32_t,
                                         omniapi_session_handle,
                                         int32_t *,
                                         omni_login_t *>
                        func_omniapi_login_ex;
                extern func_omniapi_login_ex omniapi_login_ex;

                typedef boost::function2<int32_t,
                                         omniapi_session_handle,
                                         int32_t *>
                        func_omniapi_logout_ex;
                extern func_omniapi_logout_ex omniapi_logout_ex;

                typedef boost::function3<int32_t,
                                         omniapi_session_handle,
                                         int32_t *,
                                         omni_set_password_t *>
                        func_omniapi_set_newpwd_ex;
                extern func_omniapi_set_newpwd_ex omniapi_set_newpwd_ex;
#endif
            }
        }
    }
}

#endif
